package handle

import (
	"chat/Intends/model"
	"chat/golden"
	"fmt"
)

type ChatLogin struct {
}

func ChatLogins() *ChatLogin {
	return &ChatLogin{}
}

func ChatLoginTest() uint {

	var db model.User

	golden.DB.Where("username = ?", db.Username).Find(&db)

	if db.ID == 0 {
		db = model.User{
			Username: db.Username,
			Password: db.Password,
		}
		golden.DB.Create(db)
	} else {
		if db.Password != db.Password {
			fmt.Println("您输入的密码不正确")
		}
	}
	return db.ID
}
